# Maintainer: Andrew Sun <adsun701@gmail.com>

_gemname=pkg-config
_realname=ruby-${_gemname}
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.4.9
pkgrel=1
pkgdesc="Implementation of pkg-config in ruby (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
url="https://github.com/ruby-gnome2/pkg-config"
license=('spdx:LGPL-2.1-or-later')
depends=("${MINGW_PACKAGE_PREFIX}-ruby")
provides=("${MINGW_PACKAGE_PREFIX}-ruby-pkgconfig")
replaces=("${MINGW_PACKAGE_PREFIX}-ruby-pkgconfig")
conflicts=("${MINGW_PACKAGE_PREFIX}-ruby-pkgconfig")
source=("https://rubygems.org/downloads/${_gemname}-${pkgver}.gem")
noextract=("${_gemname}-${pkgver}.gem")
sha256sums=('14968c3fec94a66f53a273b74478ed6372f2cf9a08bc081ba7642878ebac3b6d')

package() {
  local _gemdir="$(ruby -e 'puts Gem.default_dir')"
  _gemdir="$(cygpath -u ${_gemdir})"
  
  ${MINGW_PREFIX}/bin/gem install --ignore-dependencies --no-user-install -i "${pkgdir}${_gemdir}" -n "${pkgdir}${MINGW_PREFIX}/bin" ${_gemname}-${pkgver}.gem
  
  rm "${pkgdir}${_gemdir}/cache/${_gemname}-${pkgver}.gem"  
}
